home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 04 - 1988 / 04.10 Oct 88 / Transfer DA Code Update / Read Me < prev    next >
Encoding:
Text File  |  1989-01-21  |  1.7 KB  |  45 lines  |  [TEXT/MPS ]

  1. Creating the Transfer DA
  2. ------------------------
  3. The Transfer DA is written for TML Pascal 2.5 (not the TML MPW
  4. Pascal), and MDS Assembler.  It consists of an MDEF, and LDEF
  5. and the DRVR.
  6.  
  7. To create the DA:
  8.  
  9.     •    First compile all the Pascal source.  Choosing
  10.         “Transfer.pfiles” from the compiler will do this.
  11.  
  12.     •    Next assemble all the Assembler source.  Again, choosing
  13.         “Transfer.files” from the assembler will accomplish this.
  14.  
  15.     •    Compile the resource from MPW with the instruction
  16.             
  17.             rez rsrc.r -o rsrc
  18.     
  19.     •    Finally, link all the pieces:  the MDEF, the LDEF, the DRVR
  20.         and, last of all, the DA.  The link control files are
  21.         “MDEF.link”, “LDEF.link”, “DRVR.link” and “Transfer DA.link”,
  22.         respectively.
  23.  
  24. In case you don't have MDS or Rez, I've included a complete set of
  25. intermediate files.
  26.  
  27. Passing Data to the MDEF
  28. ------------------------
  29. Both the MDEF and the LDEF use the DA's private menu data; the
  30. “menudata” field of the global storage record contains a handle
  31. to this data.  It's easy to pass this data to the LDEF; just put it
  32. in the list's refcon.  Passing it to the MDEF is a bit trickier.
  33.  
  34. First, the MDEF needs a place to store it (and other, scrolling-
  35. related, globals).  Since this MDEF is for just one menu, it can
  36. keep menu globals in its code (if there were other menus using the
  37. MDEF, it would be better to keep a handle to an array of global
  38. data sets, one for each menu, in the MDEF).  The assembler routines
  39. in “data.asm” access this data.
  40.  
  41. Next, the DRVR needs a way to send the data to the MDEF.  Simple -
  42. just invent another MDEF message, “msethandle”, which passes the
  43. “menudata” handle in the “hitpoint” field.  Now the MDEF can get
  44. and use the menu data.
  45.